<template>
  <yd-popup v-model="show2" position="bottom" height="80vh">
    <div class="pay_content">
      <yd-flexbox  class="pay_title">
        <yd-flexbox-item style="text-align: left;"><img src="../../assets/api/left_arrow.png" style="width: .4rem;height: .4rem;"  @click="show2 = false"></yd-flexbox-item>
        <yd-flexbox-item><b>确认支付</b></yd-flexbox-item>
        <yd-flexbox-item style="text-align: right;color: #e72a26" @click.native="rechargeBtn">优惠充值</yd-flexbox-item>
      </yd-flexbox>

      <div class="pay_center">
        <img :src="apiLogo" class="pay_img">
        <span style="margin-left: 5px;">{{productTitle}}</span>
      </div>
      <p class="pay_count">￥{{productPrice}}</p>
      <div class="pay_way" v-if="normalBalance">
        <div>
          <img src="../../assets/api/balance.png" class="pay_logo">
          <span style="margin-left: 5px;">余额支付</span>
        </div>
        <img :src="payWay2" class="pay_logo" @click="changePay2()">
      </div>
      <div class="pay_way">
        <div>
          <img src="../../assets/api/wx.png" class="pay_logo">
          <span style="margin-left: 5px;">微信支付</span>
        </div>
        <img :src="payWay" class="pay_logo" @click="changePay()">
      </div>
      <div class="pay_way" v-if="balanceOpacity">
        <div>
          <img src="../../assets/api/balance.png" class="pay_logo">
          <span style="margin-left: 5px;">余额支付</span>
        </div>
        <span>余额不足(剩余{{balanceCount}}元)</span>
      </div>

      <div  class="agree_ment">
        <img src="../../assets/api/chos.png"  class="agree_img" @click="chosTex()" v-if="showTex">
        <img src="../../assets/api/chos_no.png" class="agree_img" @click="chosTex()" v-else>
        <span>同意</span><span style="color: #21a8ee" @click="agreeTwo()">《用户查询服务授权协议》</span>
      </div>
    </div>
    <div @click="payBtn()" class="pay_btn">
      <div>
        <span>确认支付</span><span>￥{{productPrice}}</span>
      </div>
    </div>

  </yd-popup>
</template>

<script>
  import wx from 'weixin-js-sdk';
    export default {
        name: "pay_part",
        data(){
          return{
            payWay:require('../../assets/api/no.png'),
            payWay2:require('../../assets/api/right.png'),
            showTex:true,
            show2:false,
            payNum:2,
            balanceOpacity:false,
            NEW_OBJECT:{},
            balanceCount:'',
            normalBalance:true,
          }
        },
      props:['show-wrap','need-param','product-title','product-price','api-logo'],
      methods: {
        // agreeOne(){
        //   this.$router.push('/agreement_two')
        // },
        agreeTwo(){
          this.$router.push('/agreement_one')
        },
        changePay(){//微信
          this.payNum = 0;
          this.payWay = require('../../assets/api/right.png');
          this.payWay2 = require('../../assets/api/no.png')
        },
        changePay2() {//余额
          this.payNum = 2;
          this.payWay2 = require('../../assets/api/right.png');
          this.payWay = require('../../assets/api/no.png');
        },
        payBtn(){
          let that = this;
          if(this.showTex == false){
            return;
          }
          function payWay() {
            let p = new Promise(function(resolve,reject){
              if(that.payNum == 0){

                that.$ajax.post(window.g.apiUrl+'/wpay/jsPay.do',JSON.stringify({
                  type:"B",
                  pid:that.needParam.pid,
                  count:1
                })).then((response)=>{
                  if(response.data.code == 200){
                    let appId = response.data.data.appId;
                    let nonceStr = response.data.data.nonceStr;
                    let timeStamp = response.data.data.timeStamp;
                    let package_id = response.data.data.package;
                    let signType = response.data.data.signType;
                    let paySign = response.data.data.paySign;
                    let signature = response.data.data.signature;
                    wx.config({
                      debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
                      appId: appId, // 必填，公众号的唯一标识
                      timestamp: timeStamp, // 必填，生成签名的时间戳
                      nonceStr: nonceStr, // 必填，生成签名的随机串
                      signature:signature,// 必填，签名，见附录1
                      jsApiList: ['chooseWXPay'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2，如果只是支付，只用这一个参数就够了
                    });
                    wx.ready(function(){
                      wx.chooseWXPay({
                        timestamp: timeStamp, // 支付签名时间戳，注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
                        nonceStr: nonceStr, // 支付签名随机串，不长于 32 位
                        package: package_id, // 统一支付接口返回的prepay_id参数值，提交格式如：prepay_id=***）
                        signType:  signType, // 签名方式，默认为'SHA1'，使用新版支付需传入'MD5'
                        paySign: paySign, // 支付签名
                        success: function (res) {
                          resolve();
                        },
                        //如果你按照正常的jQuery逻辑，下面如果发送错误，一定是error，那你就太天真了，当然，jssdk文档中也有提到
                        fail: function(res) {
                          //接口调用失败时执行的回调函数。
                          that.$dialog.notify({
                            mes: '支付失败',
                            timeout: 1500,
                          });
                        },
                        complete: function(res) {
                          //接口调用完成时执行的回调函数，无论成功或失败都会执行。

                        },
                        cancel: function(res) {
                          //用户点击取消时的回调函数，仅部分有用户取消操作的api才会用到。
                          that.$dialog.notify({
                            mes: '支付取消',
                            timeout: 1500,
                          });
                        },
                        trigger: function(res) {
                          //监听Menu中的按钮点击时触发的方法，该方法仅支持Menu中的相关接口。

                        }
                      });
                    });

                  }else if(response.data.code == 506){
                    that.$dialog.notify({
                      mes: '未绑定公众号，请绑定后重试',
                      timeout: 1500,
                    });
                  }else{
                    that.$dialog.notify({
                      mes: '支付失败，请稍后重试',
                      timeout: 1500,
                    });
                  }
                }).catch(()=>{
                })

              }else{
                resolve();
              }
            })
            return p;
          }

          payWay().then(function(){

          switch (that.productTitle)
          {
            case '身份证二要素验证':
              that.$dialog.loading.open('正在验证');
              setTimeout(()=>{
              that.$ajax.post(window.g.apiUrl+'/song/idCradTwo.do',JSON.stringify({
                pid:that.needParam.pid,
                name:that.needParam.name,
                idNumber:that.needParam.code,
                payChannel:that.payNum,
              })).then((response)=>{
                that.$dialog.loading.close();
                if(response.data.code == 200 || response.data.code == 1001 || response.data.code == 1002 || response.data.code == 1003){
                  that.NEW_OBJECT.name = that.needParam.name;
                  that.NEW_OBJECT.codeid = that.needParam.code;
                  that.NEW_OBJECT.key = response.data.data.key;
                  that.NEW_OBJECT.message = response.data.message;
                  sessionStorage.setItem('TO_OBJECT',JSON.stringify(that.NEW_OBJECT));
                  that.show2 = false;
                  that.$router.push('/id_code_result');
                }else{
                  that.show2 = false;
                  that.$dialog.notify({
                    mes:response.data.message,
                    timeout: 1500,
                  });
                }
              }).catch(()=>{
              })
              },150)
            break;
            case '身份证二要素返照片':
              that.$dialog.loading.open('正在验证');
              setTimeout(()=>{
              that.$ajax.post(window.g.apiUrl+'/song/idCradTwoPic.do',JSON.stringify({
                pid:that.needParam.pid,
                name:that.needParam.name,
                idNumber:that.needParam.code,
                payChannel:that.payNum,
              })).then((response)=>{
                that.$dialog.loading.close();
                if(response.data.code == 200 || response.data.code == 1001 || response.data.code == 1002 || response.data.code == 1003){
                  that.NEW_OBJECT.name = that.needParam.name;
                  that.NEW_OBJECT.codeid = that.needParam.code;
                  that.NEW_OBJECT.key = response.data.data.key;
                  that.NEW_OBJECT.photo = response.data.data.photo;
                  that.NEW_OBJECT.message = response.data.message;
                  sessionStorage.setItem('TO_OBJECT',JSON.stringify(that.NEW_OBJECT));
                  that.show2 = false;
                  that.$router.push('/id_copic_result');
                }else{
                  that.show2 = false;
                  that.$dialog.notify({
                    mes:response.data.message,
                    timeout: 1500,
                  });
                }
              }).catch(()=>{
              })
              },150)
            break;
            case '银行卡一要素查询':
              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
              that.$ajax.post(window.g.apiUrl+'/song/bankCardS.do',JSON.stringify({
                pid:that.needParam.pid,
                cardId:that.needParam.bankid,
                payChannel:that.payNum,
              })).then((response)=>{
                that.$dialog.loading.close();
                if(response.data.code == 200 || response.data.code == 1001 || response.data.code == 1002 || response.data.code == 1003){
                  that.NEW_OBJECT.bankid = that.needParam.bankid;
                  that.NEW_OBJECT.message = response.data.message;
                  that.NEW_OBJECT.accountBank = response.data.data.accountBank;
                  that.NEW_OBJECT.accountType = response.data.data.accountType;
                  sessionStorage.setItem('TO_OBJECT',JSON.stringify(that.NEW_OBJECT));
                  that.show2 = false;
                  that.$router.push('/bank_one_result');
                }else{
                  that.show2 = false;
                  that.$dialog.notify({
                    mes:response.data.message,
                    timeout: 1500,
                  });
                }
              }).catch(()=>{
              })
              },150)
              break;
            case '银行卡二要素验证':
              that.$dialog.loading.open('正在验证');
              setTimeout(()=>{
              that.$ajax.post(window.g.apiUrl+'/song/bankCardTwo.do',JSON.stringify({
                pid:that.needParam.pid,
                cardId:that.needParam.bankid,
                payChannel:that.payNum,
                name:that.needParam.name,
              })).then((response)=>{
                that.$dialog.loading.close();
                if(response.data.code == 200 || response.data.code == 1001 || response.data.code == 1002 || response.data.code == 1003){
                  that.NEW_OBJECT.name = that.needParam.name;
                  that.NEW_OBJECT.bankid = that.needParam.bankid;
                  that.NEW_OBJECT.key = response.data.data.key;
                  that.NEW_OBJECT.message = response.data.message;
                  sessionStorage.setItem('TO_OBJECT',JSON.stringify(that.NEW_OBJECT));
                  that.show2 = false;
                  that.$router.push('/bank_two_result');
                }else{
                  that.show2 = false;
                  that.$dialog.notify({
                    mes:response.data.message,
                    timeout: 1500,
                  });
                }
              }).catch(()=>{
              })
              },150)
              break;
            case '银行卡三要素验证':
              that.$dialog.loading.open('正在验证');
              setTimeout(()=>{
              that.$ajax.post(window.g.apiUrl+'/song/bankCardThree.do',JSON.stringify({
                pid:that.needParam.pid,
                bankCard:that.needParam.bankid,
                payChannel:that.payNum,
                name:that.needParam.name,
                idNumber:that.needParam.codeid,
              })).then((response)=>{
                that.$dialog.loading.close();
                if(response.data.code == 200 || response.data.code == 1001 || response.data.code == 1002 || response.data.code == 1003){
                  that.NEW_OBJECT.name = that.needParam.name;
                  that.NEW_OBJECT.codeid = that.needParam.codeid;
                  that.NEW_OBJECT.key = response.data.data.key;
                  that.NEW_OBJECT.bankid = that.needParam.bankid;
                  that.NEW_OBJECT.message = response.data.message;
                  sessionStorage.setItem('TO_OBJECT',JSON.stringify(that.NEW_OBJECT));
                  that.show2 = false;
                  that.$router.push('/bank_three_result');
                }else{
                  that.show2 = false;
                  that.$dialog.notify({
                    mes:response.data.message,
                    timeout: 1500,
                  });
                }
              }).catch(()=>{
              })
              },150)
              break;
            case '银行卡四要素验证':
              that.$dialog.loading.open('正在验证');
              setTimeout(()=>{
              that.$ajax.post(window.g.apiUrl+'/song/bankCardFour.do',JSON.stringify({
                pid:that.needParam.pid,
                bankCard:that.needParam.bankid,
                payChannel:that.payNum,
                name:that.needParam.name,
                idNumber:that.needParam.codeid,
                mobile:that.needParam.phone,
              })).then((response)=>{
                that.$dialog.loading.close();
                if(response.data.code == 200 || response.data.code == 1001 || response.data.code == 1002 || response.data.code == 1003){
                  that.NEW_OBJECT.name = that.needParam.name;
                  that.NEW_OBJECT.codeid = that.needParam.codeid;
                  that.NEW_OBJECT.key = response.data.data.key;
                  that.NEW_OBJECT.bankid = that.needParam.bankid;
                  that.NEW_OBJECT.phone = that.needParam.phone;
                  that.NEW_OBJECT.message = response.data.message;
                  sessionStorage.setItem('TO_OBJECT',JSON.stringify(that.NEW_OBJECT));
                  that.show2 = false;
                  that.$router.push('/bank_four_result');
                }else{
                  that.show2 = false;
                  that.$dialog.notify({
                    mes:response.data.message,
                    timeout: 1500,
                  });
                }
              }).catch(()=>{
              })
              },150)
              break;
            case '运营商二要素验证':
              that.$dialog.loading.open('正在验证');
              setTimeout(()=>{
              that.$ajax.post(window.g.apiUrl+'/song/operatorTwo.do',JSON.stringify({
                pid:that.needParam.pid,
                payChannel:that.payNum,
                name:that.needParam.name,
                mobile:that.needParam.phone,
              })).then((response)=>{
                that.$dialog.loading.close();
                if(response.data.code == 200 || response.data.code == 1001 || response.data.code == 1002 || response.data.code == 1003){
                  that.NEW_OBJECT.name = that.needParam.name;
                  that.NEW_OBJECT.key = response.data.data.key;
                  that.NEW_OBJECT.phone = that.needParam.phone;
                  that.NEW_OBJECT.isp = response.data.data.isp;
                  that.NEW_OBJECT.message = response.data.message;
                  sessionStorage.setItem('TO_OBJECT',JSON.stringify(that.NEW_OBJECT));
                  that.show2 = false;
                  that.$router.push('/operator_two_result');
                }else{
                  that.show2 = false;
                  that.$dialog.notify({
                    mes:response.data.message,
                    timeout: 1500,
                  });
                }
              }).catch(()=>{
              })
              },150)
              break;
            case '运营商三要素验证':
              that.$dialog.loading.open('正在验证');
              setTimeout(()=>{
              that.$ajax.post(window.g.apiUrl+'/songsun/operatorAuth.do',JSON.stringify({
                pid:that.needParam.pid,
                payChannel:that.payNum,
                name:that.needParam.name,
                mobile:that.needParam.phone,
                idNumber:that.needParam.cardid,
              })).then((response)=>{
                that.$dialog.loading.close();
                if(response.data.code == 200 || response.data.code == 1001 || response.data.code == 1002 || response.data.code == 1003){
                  that.NEW_OBJECT.name = that.needParam.name;
                  that.NEW_OBJECT.key = response.data.data.key;
                  that.NEW_OBJECT.phone = that.needParam.phone;
                  that.NEW_OBJECT.cardid = that.needParam.cardid;
                  that.NEW_OBJECT.isp = response.data.data.isp;
                  that.NEW_OBJECT.message = response.data.message;
                  sessionStorage.setItem('TO_OBJECT',JSON.stringify(that.NEW_OBJECT));
                  that.show2 = false;
                  that.$router.push('/operator_three_result');
                }else{
                  that.show2 = false;
                  that.$dialog.notify({
                    mes:response.data.message,
                    timeout: 1500,
                  });
                }
              }).catch(()=>{
              })
              },150)
              break;
            case '手机在网状态查询':
              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
                that.$ajax.post(window.g.apiUrl+'/song/pStatus.do',JSON.stringify({
                  pid:that.needParam.pid,
                  payChannel:that.payNum,
                  phone:that.needParam.phone,
                })).then((response)=>{
                  that.$dialog.loading.close();

                  if(response.data.code == 200 || response.data.code == 1001 || response.data.code == 1002 || response.data.code == 1003){
                    that.NEW_OBJECT.phone = that.needParam.phone;
                    that.NEW_OBJECT.operators = response.data.data.operators;
                    that.NEW_OBJECT.status = response.data.data.status;
                      that.NEW_OBJECT.message = response.data.message;
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(that.NEW_OBJECT));
                    that.show2 = false;
                    that.$router.push('/mobile_net_result');
                  }else{
                    that.show2 = false;
                    that.$dialog.notify({
                      mes:response.data.message,
                      timeout: 1500,
                    });
                  }
                }).catch(()=>{
                })
              },150)
              break;
            case '手机入网时长查询':
              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
                that.$ajax.post(window.g.apiUrl+'/songsun/webTime.do ',JSON.stringify({
                  pid:that.needParam.pid,
                  payChannel:that.payNum,
                  phone:that.needParam.phone,
                })).then((response)=>{
                  that.$dialog.loading.close();

                  if(response.data.code == 200 || response.data.code == 1001 || response.data.code == 1002 || response.data.code == 1003){
                    that.NEW_OBJECT.phone = that.needParam.phone;
                    that.NEW_OBJECT.OUTPUT1 = response.data.data.OUTPUT1;
                    that.NEW_OBJECT.isp = response.data.data.isp;
                    that.NEW_OBJECT.message = response.data.message;
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(that.NEW_OBJECT));
                    that.show2 = false;
                    that.$router.push('/mobile_enter_result');
                  }else{
                    that.show2 = false;
                    that.$dialog.notify({
                      mes:response.data.message,
                      timeout: 1500,
                    });
                  }
                }).catch(()=>{
                })
              },150)
              break;
            case '货车司机验证':
              that.$dialog.loading.open('正在验证');
              setTimeout(()=>{
                that.$ajax.post(window.g.apiUrl+'/driver/driverVer.do',JSON.stringify({
                  pid:that.needParam.pid,
                  payChannel:that.payNum,
                  driverPhone:that.needParam.phone,
                  driverCarNo:that.needParam.code.toUpperCase(),
                  driverName:that.needParam.name,
                })).then((response)=>{
                  that.$dialog.loading.close();
                  if(response.data.code == 200 || response.data.code == 1001 || response.data.code == 1002 || response.data.code == 1003){
                    that.NEW_OBJECT.phone = that.needParam.phone;
                    that.NEW_OBJECT.name = that.needParam.name;
                    that.NEW_OBJECT.code = that.needParam.code;
                    that.NEW_OBJECT.result = response.data.result.result;
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(that.NEW_OBJECT));
                    that.show2 = false;
                    that.$router.push('/truck_driver_result');
                  }else{
                    that.show2 = false;
                    that.$dialog.notify({
                      mes:response.data.message,
                      timeout: 1500,
                    });
                  }
                }).catch(()=>{
                })
              },150)
              break;
            case '运价查询':
              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
                that.$ajax.post(window.g.apiUrl+'/reckon/getReckon.do',JSON.stringify({
                  pid:that.needParam.pid,
                  unit:that.needParam.weight,
                  carType:that.needParam.chexing,
                  carLong:that.needParam.chechang,
                  fromCode:that.needParam.startid,
                  toCode:that.needParam.endid,
                })).then((response)=>{

                  if(response.data.code == 200){
                    that.NEW_OBJECT.phone = response.data.data.distance;
                    that.NEW_OBJECT.time = response.data.data.time;
                    that.NEW_OBJECT.price = response.data.data.price;
                    that.NEW_OBJECT.distance = response.data.data.distance;
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(that.NEW_OBJECT));

                    that.$ajax.post(window.g.apiUrl+'/reckon/getTrend.do',JSON.stringify({
                      pid:that.needParam.pid,
                      unit:that.needParam.weight,
                      carType:that.needParam.chexing,
                      carLong:that.needParam.carLong,
                      fromCode:that.needParam.startid,
                      toCode:that.needParam.endid,
                    })).then((response)=>{
                        if(response.data.code == 200){
                          let obj = {};
                          obj.month = response.data.data.month;
                          obj.priceMonth = response.data.data.priceMonth;
                          sessionStorage.setItem('YUNJIA',JSON.stringify(obj))
                          that.$ajax.post(window.g.apiUrl+'/reckon/getRecommend.do',JSON.stringify({
                            pid:that.needParam.pid,
                            unit:that.needParam.weight,
                            carType:that.needParam.chexing,
                            carLong:that.needParam.carLong,
                            fromCode:that.needParam.startid,
                            toCode:that.needParam.endid,
                            payChannel:that.payNum,
                          })).then((response)=>{
                            that.$dialog.loading.close();
                            if(response.data.code == 200){
                              that.show2 = false;
                              let obj = {};
                              obj.data = response.data.data;
                              sessionStorage.setItem('SHOP',JSON.stringify(obj))
                              that.$router.push('/price_query_result');
                            }else{
                              that.$dialog.notify({
                                mes:'查询失败，请稍后重试',
                                timeout: 1500,
                              });
                            }
                          }).catch(()=>{
                          })

                        }else{
                          that.$dialog.loading.close();
                          that.$dialog.notify({
                            mes:'查询失败，请稍后重试',
                            timeout: 1500,
                          });
                        }
                      }).catch(()=>{
                    })

                  }else{
                    that.$dialog.loading.close();
                    that.show2 = false;
                    that.$dialog.notify({
                      mes:response.data.message,
                      timeout: 1500,
                    });
                  }
                }).catch(()=>{
                })
              },150)
              break;
            case '物流园查询':

              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
              that.$ajax.post(window.g.apiUrl+'/reckon/getPark.do',JSON.stringify({
                pid:that.needParam.pid,
                payChannel:that.payNum,
                code:that.needParam.startid,
              })).then((response)=>{
                that.$dialog.loading.close();
                if(response.data.code == 200){
                  let obj = {};
                  obj.data = response.data.data;
                  sessionStorage.setItem('TO_OBJECT',JSON.stringify(obj));
                  that.show2 = false;
                  that.$router.push('/logistics_area_result');
                }else{
                  that.$dialog.notify({
                    mes:'查询失败，请稍后重试',
                    timeout: 1500,
                  });
                }
              }).catch(()=>{
              })
              },150)
              break;
            case '企业工商风险查询':

              that.$dialog.loading.open('正在查询');

              setTimeout(()=>{

                that.$ajax.post(window.g.apiUrl+'/detail/getComId.do',JSON.stringify({
                  name:that.needParam.name,
                })).then((response)=>{
                  if(response.data.code == 200){
                   let comid = response.data.data;
                    that.$ajax.post(window.g.apiUrl+'/detail/getComBasic.do', JSON.stringify({
                      localId: comid,
                      pid: that.needParam.pid,
                      payChannel: 2,
                    })).then((response) => {
                      that.$dialog.loading.close();
                      if (response.data.code == 200) {
                        let obj = {};
                        obj.id = comid;
                        obj.companyOrgType = response.data.result.companyOrgType == '' || response.data.result.companyOrgType == undefined ? '未公开' : response.data.result.companyOrgType;
                        obj.regCapital = response.data.result.regCapital == '' || response.data.result.regCapital == undefined ? '未公开' : response.data.result.regCapital;
                        obj.industry = response.data.result.industry == '' || response.data.result.industry == undefined ? '未公开' : response.data.result.industry;
                        obj.name = response.data.result.name == undefined ? '' : response.data.result.name;
                        obj.regStatus = response.data.result.regStatus == undefined ? '' : response.data.result.regStatus;
                        obj.legalPersonName = response.data.result.legalPersonName == '' || response.data.result.legalPersonName == undefined ? '未公开' : response.data.result.legalPersonName;
                        obj.estiblishTime = response.data.result.estiblishTime == undefined ? '' : response.data.result.estiblishTime.substr(0, 10);
                        obj.regInstitute = response.data.result.regInstitute == '' || response.data.result.regInstitute == undefined ? '未公开' : response.data.result.regInstitute;
                        obj.regLocation = response.data.result.regLocation == '' || response.data.result.regLocation == undefined ? '未公开' : response.data.result.regLocation;
                        obj.businessScope = response.data.result.businessScope == '' || response.data.result.businessScope == undefined ? '未公开' : response.data.result.businessScope;
                        obj.creditCode = response.data.result.creditCode == '' || response.data.result.creditCode == undefined ? '未公开' : response.data.result.creditCode;
                        obj.orgNumber = response.data.result.orgNumber == '' || response.data.result.orgNumber == undefined ? '未公开' : response.data.result.orgNumber;
                        obj.regNumber = response.data.result.regNumber == '' || response.data.result.regNumber == undefined ? '未公开' : response.data.result.regNumber;
                        obj.flag = response.data.result.follow;
                        obj.fromTime = response.data.result.fromTime == '' || response.data.result.fromTime == undefined ? '未公开' : new Date(parseInt(response.data.result.fromTime)).toLocaleDateString().split('/').join('-');
                        obj.toTime = response.data.result.toTime == '' || response.data.result.toTime == undefined ? '无固定期限' : new Date(parseInt(response.data.result.toTime)).toLocaleDateString().split('/').join('-');
                        obj.approvedTime = response.data.result.approvedTime == '' || response.data.result.approvedTime == undefined ? '未公开' : new Date(parseInt(response.data.result.approvedTime)).toLocaleDateString().split('/').join('-');
                        sessionStorage.setItem('TO_OBJECT',JSON.stringify(obj));
                        that.show2 = false;
                        that.$emit('change','ok');
                        that.$router.push('/company_info');
                      }else{
                        that.$dialog.notify({
                          mes:'查询失败，请稍后重试',
                          timeout: 1500,
                        });
                      }
                    }).catch(()=>{
                    })
                  }else{
                    that.$dialog.notify({
                      mes: '信息获取超时，请稍后重试',
                      timeout: 1500,
                    });
                  }

                }).catch(()=>{
                })
              },150)
              break;
            case '手机号基本信息查询':
              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
                that.$ajax.post(window.g.apiUrl+'/xiao/MobileRegionCheck.do',JSON.stringify({
                  pid:that.needParam.pid,
                  payChannel:that.payNum,
                  mobile:that.needParam.phone,
                })).then((response)=>{
                  that.$dialog.loading.close();

                  if(response.data.code == 200 || response.data.code == 1001 || response.data.code == 1002 || response.data.code == 1003){
                    that.NEW_OBJECT.address = response.data.data.provincename+response.data.data.areaname;
                    that.NEW_OBJECT.isp = response.data.data.isp;
                    that.NEW_OBJECT.desc = response.data.data.desc;
                    that.NEW_OBJECT.message = response.data.message;
                    that.NEW_OBJECT.phone = that.needParam.phone;
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(that.NEW_OBJECT));
                    that.show2 = false;
                    that.$router.push('/mobile_info_result');
                  }else{
                    that.show2 = false;
                    that.$dialog.notify({
                      mes:response.data.message,
                      timeout: 1500,
                    });
                  }
                }).catch(()=>{
                })
              },150)
              break;
            case '逾期黑名单验证':
              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
                that.$ajax.post(window.g.apiUrl+'/xiaos/blackListCheck.do',JSON.stringify({
                  pid:that.needParam.pid,
                  payChannel:that.payNum,
                  mobile:that.needParam.phone,
                  name:that.needParam.name,
                  idCard:that.needParam.cardid,
                })).then((response)=>{
                  that.$dialog.loading.close();

                  if(response.data.code == 200 || response.data.code == 1001 || response.data.code == 1002 || response.data.code == 1003){
                    that.NEW_OBJECT.phone = that.needParam.phone;
                    that.NEW_OBJECT.name = that.needParam.name;
                    that.NEW_OBJECT.codeid = that.needParam.cardid;
                    that.NEW_OBJECT.message = response.data.message;
                    that.NEW_OBJECT.key = response.data.data.key;
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(that.NEW_OBJECT));
                    that.show2 = false;
                    that.$router.push('/overdue_result');
                  }else{
                    that.show2 = false;
                    that.$dialog.notify({
                      mes:response.data.message,
                      timeout: 1500,
                    });
                  }
                }).catch(()=>{
                })
              },150)
              break;
            case '通信小号验证':
              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
                that.$ajax.post(window.g.apiUrl+'/xiao/specialMobileCheck.do',JSON.stringify({
                  pid:that.needParam.pid,
                  payChannel:that.payNum,
                  mobile:that.needParam.phone,
                })).then((response)=>{
                  that.$dialog.loading.close();

                  if(response.data.code == 200 || response.data.code == 1001 || response.data.code == 1002 || response.data.code == 1003){
                    that.NEW_OBJECT.phone = that.needParam.phone;
                    that.NEW_OBJECT.message = response.data.message;
                    that.NEW_OBJECT.key = response.data.data.key;
                    if(response.data.data.key == 1){
                      that.NEW_OBJECT.updateTime = response.data.data.DETAIL.updateTime;
                    }
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(that.NEW_OBJECT));
                    that.show2 = false;
                    that.$router.push('/mobile_smal_result');
                  }else{
                    that.show2 = false;
                    that.$dialog.notify({
                      mes:response.data.message,
                      timeout: 1500,
                    });
                  }
                }).catch(()=>{
                })
              },150)
              break;
            case '风险审核报告（精简版）':
              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
                //http://127.0.0.1:90/reckon/getRiskS.do
                //https://www.easy-mock.com/mock/5b4e9bec73960562e6fd7ef5/web/chuxian/fxEasy
                that.$ajax.post(window.g.apiUrl+'/reckon/getRiskS.do',JSON.stringify({
                  pid:that.needParam.pid,
                  payChannel:that.payNum,
                  name:that.needParam.name,
                  mobile:that.needParam.phone,
                  idCard:that.needParam.cardid,
                })).then((response)=>{
                  that.$dialog.loading.close();
                  if(response.data.code == 200){
                    let obj = {
                      userInfo:{},
                      infoList:[],
                    };
                    obj.userInfo.age = response.data.data.userbasic.age;
                    obj.userInfo.birth = response.data.data.userbasic.birth;
                    obj.userInfo.city = response.data.data.userbasic.province+response.data.data.userbasic.city;
                    obj.userInfo.count = response.data.data.userbasic.count;
                    obj.userInfo.idCard = response.data.data.userbasic.idCard;
                    obj.userInfo.mobile = response.data.data.userbasic.mobile;
                    obj.userInfo.name = response.data.data.userbasic.name;
                    obj.userInfo.out_trade_no = response.data.data.userbasic.out_trade_no;
                    // obj.userInfo.province = response.data.data.userbasic.province;
                    obj.userInfo.sex = response.data.data.userbasic.sex;
                    obj.userInfo.time = response.data.data.userbasic.time;
                    obj.userInfo.statMsg = response.data.data.IDCardImage.statMsg;
                    obj.userInfo.photo = response.data.data.IDCardImage.photo;
                    obj.userInfo.isp = response.data.data.MobileRegionCheck.isp;
                    obj.userInfo.attribution = response.data.data.MobileRegionCheck.provincename+response.data.data.MobileRegionCheck.areaname;
                    let obj2 = {};
                    obj2.one = '手机号命中通信小号库';
                    if(response.data.data.SpecialMobile.statCode == 1){
                      obj2.two = '命中';
                      obj2.three = '';
                      obj2.num = 1;
                    }else if(response.data.data.SpecialMobile.statCode == 2){
                      obj2.two = '未命中';
                      obj2.three = '';
                      obj2.num = 2;
                    }else{
                      obj2.two = response.data.data.SpecialMobile.statMsg;
                      obj2.three = '';
                      obj2.num = 0;
                    }
                    obj.infoList.push(obj2);
                    let obj3 = {};
                    obj3.one = '身份证命中前科人员名单';
                    if(response.data.data.harmful.qianke == 1){
                      obj3.two = '命中';
                      let time = response.data.data.harmful.caseTime.replace('[','').replace(']','');
                      let showTime;
                      switch (time){
                        case '"[0,0.25)"':
                          showTime = '3个月以内';
                          break;
                        case '"[0.25,0.5)"':
                          showTime = '3~6个月';
                          break;
                        case '"[0.5,1)"':
                          showTime = '6个月~1年';
                          break;
                        case '"[1,2)"':
                          showTime = '1~2年';
                          break;
                        case '"[2,5)"':
                          showTime = '2~5年';
                          break;
                        case '"[5,10)"':
                          showTime = '5~10年';
                          break;
                        case '"[10,15)"':
                          showTime = '10~15年';
                          break;
                        case '"[15,20)"':
                          showTime = '15~20年';
                          break;
                        case '"20年以上"':
                          showTime = '20年以上';
                          break;
                      }
                      obj3.three = '案发距今'+showTime;
                      obj3.num = 1;
                    }else{
                      obj3.two = '未命中';
                      obj3.three = '';
                      obj3.num = 2;
                    }
                    obj.infoList.push(obj3);

                    let obj4 = {};
                    obj4.one = '身份证命中逾期黑名单';
                    obj4.three = '';
                    if(response.data.data.BlackListCheck.statCode == 1){
                      obj4.two = '命中';
                      obj4.num = 1;
                    }else if(response.data.data.BlackListCheck.statCode == 2){
                      obj4.two = '未命中';
                      obj4.num = 2;
                    }else{
                      obj4.two = response.data.data.BlackListCheck.statMsg;
                      obj4.num = 0;
                    }
                    obj.infoList.push(obj4);

                    let obj5 = {};
                    obj5.one = '身份证号与姓名不一致';
                    obj5.three = '';
                    if(response.data.data.IDCardImage.statCode != 1 && response.data.data.IDCardImage.statCode != -1){
                      obj5.two = '命中';
                      obj5.num = 1;
                    }else if(response.data.data.IDCardImage.statCode == -1){
                      obj5.two = response.data.data.IDCardImage.statMsg;
                      obj5.num = 0;
                    }else{
                      obj5.two = '未命中';
                      obj5.num = 2;
                    }
                    obj.infoList.unshift(obj5);
                    let obj6 = {};
                    obj6.one = '身份证命中在逃人员名单';
                    obj6.three = '';
                    if(response.data.data.harmful.zaitao == 1){
                      obj6.two = '命中';
                      obj6.num = 1;
                    }else{
                      obj6.two = '未命中';
                      obj6.num = 2;
                    }
                    obj.infoList.push(obj6);
                    let obj7 = {};
                    obj7.one = '身份证命中吸毒人员名单';
                    obj7.three = '';
                    if(response.data.data.harmful.xidu == 1){
                      obj7.two = '命中';
                      obj7.num = 1;
                    }else{
                      obj7.two = '未命中';
                      obj7.num = 2;
                    }
                    obj.infoList.push(obj7);
                    let obj8 = {};
                    obj8.one = '身份证命中涉毒人员名单';
                    obj8.three = '';
                    if(response.data.data.harmful.shedu == 1){
                      obj8.two = '命中';
                      obj8.num = 1;
                    }else{
                      obj8.two = '未命中';
                      obj8.num = 2;
                    }
                    obj.infoList.push(obj8);

                    obj.infoList.sort(function(i1,i2){
                      if(i1.num < i2.num){
                        return -1;
                      }else if(i1.num > i2.num){
                        return 1;
                      }else{
                        return 0;
                      }
                    });
                      sessionStorage.setItem('TO_OBJECT',JSON.stringify(obj));
                      that.show2 = false;
                      that.$router.push('/risk_report_result');

                  }else{
                    that.show2 = false;
                    that.$dialog.notify({
                      mes:response.data.message,
                      timeout: 1500,
                    });
                  }
                }).catch(()=>{
                })
              },200)
              break;
            case '风险审核报告（详细版）':
              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
                //http://127.0.0.1:90/reckon/getRiskF.do
                //https://www.easy-mock.com/mock/5b4e9bec73960562e6fd7ef5/web/chuxian/fxDIffcult
                that.$ajax.post(window.g.apiUrl+'/reckon/getRiskF.do',JSON.stringify({
                  pid:that.needParam.pid,
                  payChannel:that.payNum,
                  name:that.needParam.name,
                  mobile:that.needParam.phone,
                  idCard:that.needParam.cardid,
                })).then((response)=>{
                  that.$dialog.loading.close();
                  if(response.data.code == 200){
                    let obj = {
                      userInfo:{},
                      infoList:[],
                    };
                    obj.userInfo.age = response.data.data.userbasic.age;
                    obj.userInfo.birth = response.data.data.userbasic.birth;
                    obj.userInfo.city = response.data.data.userbasic.province+response.data.data.userbasic.city;
                    obj.userInfo.count = response.data.data.userbasic.count;
                    obj.userInfo.idCard = response.data.data.userbasic.idCard;
                    obj.userInfo.mobile = response.data.data.userbasic.mobile;
                    obj.userInfo.name = response.data.data.userbasic.name;
                    obj.userInfo.out_trade_no = response.data.data.userbasic.out_trade_no;
                    // obj.userInfo.province = response.data.data.userbasic.province;
                    obj.userInfo.sex = response.data.data.userbasic.sex;
                    obj.userInfo.time = response.data.data.userbasic.time;
                    obj.userInfo.statMsg = response.data.data.IDCardImage.statMsg;
                    obj.userInfo.photo = response.data.data.IDCardImage.photo;
                    obj.userInfo.isp = response.data.data.MobileRegionCheck.isp;
                    obj.userInfo.attribution = response.data.data.MobileRegionCheck.provincename+response.data.data.MobileRegionCheck.areaname;
                    let obj2 = {};
                    obj2.one = '手机号命中通信小号库';
                    if(response.data.data.SpecialMobile.statCode == 1){
                      obj2.two = '命中';
                      obj2.three = '';
                      obj2.num = 1;
                    }else if(response.data.data.SpecialMobile.statCode == 2){
                      obj2.two = '未命中';
                      obj2.three = '';
                      obj2.num = 2;
                    }else{
                      obj2.two = response.data.data.SpecialMobile.statMsg;
                      obj2.three = '';
                      obj2.num = 0;
                    }
                    obj.infoList.push(obj2);
                    let obj3 = {};
                    obj3.one = '身份证命中前科人员名单';
                    if(response.data.data.harmful.qianke == 1){
                      obj3.two = '命中';
                      let time = response.data.data.harmful.caseTime.replace('[','').replace(']','');
                      let showTime;
                      switch (time){
                        case '"[0,0.25)"':
                          showTime = '3个月以内';
                          break;
                        case '"[0.25,0.5)"':
                          showTime = '3~6个月';
                          break;
                        case '"[0.5,1)"':
                          showTime = '6个月~1年';
                          break;
                        case '"[1,2)"':
                          showTime = '1~2年';
                          break;
                        case '"[2,5)"':
                          showTime = '2~5年';
                          break;
                        case '"[5,10)"':
                          showTime = '5~10年';
                          break;
                        case '"[10,15)"':
                          showTime = '10~15年';
                          break;
                        case '"[15,20)"':
                          showTime = '15~20年';
                          break;
                        case '"20年以上"':
                          showTime = '20年以上';
                          break;
                      }
                      obj3.three = '案发距今'+showTime;
                      obj3.num = 1.3;
                    }else{
                      obj3.two = '未命中';
                      obj3.three = '';
                      obj3.num = 2;
                    }
                    obj.infoList.push(obj3);

                    let obj4 = {};
                    obj4.one = '身份证命中在逃人员名单';
                    if(response.data.data.harmful.zaitao == 1){
                      obj4.two = '命中';
                      obj4.num = 1.3;
                    }else{
                      obj4.two = '未命中';
                      obj4.three = '';
                      obj4.num = 2;
                    }
                    obj.infoList.push(obj4);

                    let obj5 = {};
                    obj5.one = '身份证命中吸毒人员名单';
                    if(response.data.data.harmful.xidu == 1){
                      obj5.two = '命中';
                      obj5.num = 1.3;
                    }else{
                      obj5.two = '未命中';
                      obj5.three = '';
                      obj5.num = 2;
                    }
                    obj.infoList.push(obj5);

                    let obj6 = {};
                    obj6.one = '身份证命中涉毒人员名单';
                    if(response.data.data.harmful.shedu == 1){
                      obj6.two = '命中';
                      obj6.num = 1.3;
                    }else{
                      obj6.two = '未命中';
                      obj6.three = '';
                      obj6.num = 2;
                    }
                    obj.infoList.push(obj6);

                    let obj7 = {};
                    obj7.one = '身份证命中逾期黑名单';
                    obj7.three = '';
                    if(response.data.data.BlackListCheck.statCode == 1){
                      obj7.two = '命中';
                      obj7.num = 1.3;
                    }else if(response.data.data.BlackListCheck.statCode == 2){
                      obj7.two = '未命中';
                      obj7.num = 2;
                    }else{
                      obj7.two = response.data.data.BlackListCheck.statMsg;
                      obj7.num = 0;
                    }
                    obj.infoList.push(obj7);

                    let obj8 = {};
                    obj8.one = '身份证号与姓名不一致';
                    obj8.three = '';
                    if(response.data.data.IDCardImage.statCode != 1 && response.data.data.IDCardImage.statCode != -1){
                      obj8.two = '命中';
                      obj8.num = 0.8;
                    }else if(response.data.data.IDCardImage.statCode == -1){
                      obj8.two = response.data.data.IDCardImage.statMsg;
                      obj8.num = -1;
                    }else{
                      obj8.two = '未命中';
                      obj8.num = 1.5;
                    }
                    obj.infoList.unshift(obj8);

                    let obj10 = {};
                    obj10.one = '逾期催收记录';
                    if(response.data.data.OverduePaymentDetailCheck.statCode == 1){
                      obj10.two = '命中';
                      obj10.num = 1;
                      let str = '';
                      for(let i = 0,len = response.data.data.OverduePaymentDetailCheck.detail.length;i<len;i++){
                        str += '<p style="margin-bottom: 5px;">'+`${i+1}.逾期金额：`+response.data.data.OverduePaymentDetailCheck.detail[i].money+'，催收时间：'+response.data.data.OverduePaymentDetailCheck.detail[i].Date.substring(0,response.data.data.OverduePaymentDetailCheck.detail[i].Date.length-3)+"</p>";
                      }
                      obj10.three = str;
                    }else{
                      obj10.two = '未命中';
                      obj10.num = 2;
                      obj10.three = '';
                    }
                    obj.infoList.push(obj10);

                    let obj11 = {};
                    obj11.one = '身份证命中多头借贷名单';
                    obj11.three = '';
                    if(response.data.data.longLoanApply.statCode == 1){
                      obj11.two = '命中';
                      obj11.num = 1.3;
                    }else{
                      obj11.two = '未命中';
                      obj11.num = 2;
                    }
                    obj.infoList.push(obj11);

                    let obj12 = {};
                    let obj13 = {};
                    let obj14 = {};
                    let obj15 = {};
                    obj12.one = '历史最大逾期金额';
                    obj13.one = '历史最长逾期天数';
                    obj14.one = '逾期最早出现时间';
                    obj15.one = '逾期最近出现时间';
                    if(response.data.data.oftenOwe.statCode == 1){
                      obj12.two = '命中';
                      obj13.two = '命中';
                      obj14.two = '命中';
                      obj15.two = '命中';
                      if(response.data.data.oftenOwe.detail.overdueAmountMax > 0){
                        obj12.three = response.data.data.oftenOwe.detail.overdueAmountMax+'元';
                      }else{
                        obj12.three = '';
                      }
                      if(response.data.data.oftenOwe.detail.overdueDaysMax > 0){
                        obj13.three = response.data.data.oftenOwe.detail.overdueDaysMax+'天';
                      }else{
                        obj13.three = '';
                      }
                      if(response.data.data.oftenOwe.detail.overdueEarliestTime != ''&&response.data.data.oftenOwe.detail.overdueEarliestTime != undefined){
                        obj14.three = response.data.data.oftenOwe.detail.overdueEarliestTime.substring(0,4)+'-'+response.data.data.oftenOwe.detail.overdueEarliestTime.substring(4,6)+'-'+response.data.data.oftenOwe.detail.overdueEarliestTime.substring(6,8);
                      }else{
                        obj14.three = '';
                      }
                      if(response.data.data.oftenOwe.detail.overdueLatestTime != ''&&response.data.data.oftenOwe.detail.overdueLatestTime != undefined){
                        obj15.three = response.data.data.oftenOwe.detail.overdueLatestTime.substring(0,4)+'-'+response.data.data.oftenOwe.detail.overdueLatestTime.substring(4,6)+'-'+response.data.data.oftenOwe.detail.overdueLatestTime.substring(6,8);
                      }else{
                        obj15.three = '';
                      }
                      obj12.num = 1.2;
                      obj13.num = 1.2;
                      obj14.num = 1.2;
                      obj15.num = 1.2;
                      obj.infoList.push(obj12);
                      obj.infoList.push(obj13);
                      obj.infoList.push(obj14);
                      obj.infoList.push(obj15);
                      if(response.data.data.oftenOwe.detail.overduePlatformTotal > 0){
                        let obj16 = {};
                        obj16.one = '历史逾期平台总数';
                        obj16.num = 1.2;
                        obj16.two = '命中';
                        obj16.three = response.data.data.oftenOwe.detail.overduePlatformTotal+'个';
                        obj.infoList.push(obj16);
                      }
                      if(response.data.data.oftenOwe.detail.overduePlatformToday > 0){
                        let obj17 = {};
                        obj17.one = '今日逾期平台个数';
                        obj17.num = 1.2;
                        obj17.two = '命中';
                        obj17.three = response.data.data.oftenOwe.detail.overduePlatformToday+'个';
                        obj.infoList.push(obj17);
                      }
                      if(response.data.data.oftenOwe.detail.overduePlatform3Days > 0){
                        let obj18 = {};
                        obj18.one = '近3天逾期平台个数';
                        obj18.num = 1.2;
                        obj18.two = '命中';
                        obj18.three = response.data.data.oftenOwe.detail.overduePlatform3Days+'个';
                        obj.infoList.push(obj18);
                      }
                      if(response.data.data.oftenOwe.detail.overduePlatform7Days > 0){
                        let obj19 = {};
                        obj19.one = '近7天逾期平台个数';
                        obj19.num = 1.2;
                        obj19.two = '命中';
                        obj19.three = response.data.data.oftenOwe.detail.overduePlatform7Days+'个';
                        obj.infoList.push(obj19);
                      }
                      if(response.data.data.oftenOwe.detail.overduePlatform15Days > 0){
                        let obj20 = {};
                        obj20.one = '近15天逾期平台个数';
                        obj20.num = 1.2;
                        obj20.two = '命中';
                        obj20.three = response.data.data.oftenOwe.detail.overduePlatform15Days+'个';
                        obj.infoList.push(obj20);
                      }
                      if(response.data.data.oftenOwe.detail.overduePlatform30Days > 0){
                        let obj21 = {};
                        obj21.one = '近30天逾期平台个数';
                        obj21.num = 1.2;
                        obj21.two = '命中';
                        obj21.three = response.data.data.oftenOwe.detail.overduePlatform30Days+'个';
                        obj.infoList.push(obj21);
                      }
                      if(response.data.data.oftenOwe.detail.overduePlatform60Days > 0){
                        let obj22 = {};
                        obj22.one = '近60天逾期平台个数';
                        obj22.num = 1.2;
                        obj22.two = '命中';
                        obj22.three = response.data.data.oftenOwe.detail.overduePlatform60Days+'个';
                        obj.infoList.push(obj22);
                      }
                      if(response.data.data.oftenOwe.detail.overduePlatform90Days > 0){
                        let obj23 = {};
                        obj23.one = '近90天逾期平台个数';
                        obj23.num = 1.2;
                        obj23.two = '命中';
                        obj23.three = response.data.data.oftenOwe.detail.overduePlatform90Days+'个';
                        obj.infoList.push(obj23);
                      }
                    }else{
                      obj12.two = '未命中';
                      obj13.two = '未命中';
                      obj14.two = '未命中';
                      obj15.two = '未命中';
                      obj12.num = 2;
                      obj13.num = 2;
                      obj14.num = 2;
                      obj15.num = 2;
                      obj12.three = '';
                      obj13.three = '';
                      obj14.three = '';
                      obj15.three = '';
                      obj.infoList.push(obj12);
                      obj.infoList.push(obj13);
                      obj.infoList.push(obj14);
                      obj.infoList.push(obj15);
                    }

                    obj.infoList.sort(function(i1,i2){
                      if(i1.num < i2.num){
                        return -1;
                      }else if(i1.num > i2.num){
                        return 1;
                      }else{
                        return 0;
                      }
                    });
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(obj));
                    that.show2 = false;
                    that.$router.push('/risk_com_result');
                  }else{
                    that.show2 = false;
                    that.$dialog.notify({
                      mes:response.data.message,
                      timeout: 1500,
                    });
                  }
                }).catch(()=>{
                })
              },200)
              break;
            case '车辆保单信息查询':
              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
                that.$ajax.post(window.g.apiUrl+'/xiao/CarInsuranceDetailInfo.do',JSON.stringify({
                  pid:that.needParam.pid,
                  payChannel:that.payNum,
                  carNo:that.needParam.carCode,
                  company:that.needParam.com,
                  insuranceNo:that.needParam.baodan,
                  idCard:that.needParam.code,
                })).then((response)=>{
                  that.$dialog.loading.close();

                  if(response.data.code == 200){
                    let obj = {
                      basic:{},
                      allInfo:[],
                    };
                    obj.code = response.data.code;
                    obj.basic.carType = response.data.data[0].carInfo.carType;//车辆类型
                    obj.basic.count = response.data.data[0].carInfo.count;//座位数
                    obj.basic.engineNumber = response.data.data[0].carInfo.engineNumber;//发动机号
                    obj.basic.plateNumber = response.data.data[0].carInfo.plateNumber;//车牌号
                    obj.basic.useType = response.data.data[0].carInfo.useType;//使用性质
                    obj.basic.vehicleBrand = response.data.data[0].carInfo.vehicleBrand;//车辆品牌
                    obj.basic.vin = response.data.data[0].carInfo.vin;//车架号
                    obj.allInfo = response.data.data;
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(obj));
                    that.show2 = false;
                    that.$router.push('/car_policy_result');
                  }else if(response.data.code == 1002) {
                    let obj = {};
                    obj.message = response.data.message;
                    obj.code = '1002';
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(obj));
                    that.show2 = false;
                    that.$router.push('/car_policy_result');
                  }else{
                      that.show2 = false;
                      that.$dialog.notify({
                        mes:response.data.message,
                        timeout: 1500,
                      });
                  }
                }).catch(()=>{
                })
              },150)
              break;
            case '车辆出险查询':
              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
                that.$ajax.post(window.g.apiUrl+'/xiao/VehicleInsurance.do',JSON.stringify({
                  pid:that.needParam.pid,
                  payChannel:that.payNum,
                  vin:that.needParam.carVin,
                  plateNumber:that.needParam.carCode,
                })).then((response)=>{
                  that.$dialog.loading.close();

                  if(response.data.code == 200 || response.data.code == 1001 || response.data.code == 1002 || response.data.code == 1003){
                    let obj = {
                      carArr:[],
                    };
                    obj.message = response.data.message;
                    obj.carvin = that.needParam.carVin;
                    obj.carnum = that.needParam.carCode;
                    if(response.data.code == 200){
                      obj.barterSumCount = response.data.data.resultInfo.barterSumCount;//换件总件数
                      obj.barterSumMoney = response.data.data.resultInfo.barterSumMoney;//换件总金额
                      obj.dangerSumMoney = response.data.data.resultInfo.dangerSumMoney;//理赔总金额
                      obj.serviceSumMoney = response.data.data.resultInfo.serviceSumMoney;//维修总金额
                      obj.serviceSumCount = response.data.data.resultInfo.serviceSumCount;//维修总次数
                      obj.carArr = response.data.data.resultInfo.detailInfos;
                    }
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(obj));
                    that.show2 = false;
                    that.$router.push('/car_danger_result');
                  }else{
                    that.show2 = false;
                    that.$dialog.notify({
                      mes:response.data.message,
                      timeout: 1500,
                    });
                  }
                }).catch(()=>{
                })
              },150)
              break;
            case '车辆基本信息查询':
              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
                that.$ajax.post(window.g.apiUrl+'/xiao/VehicleTypeInfo.do',JSON.stringify({
                  pid:that.needParam.pid,
                  payChannel:that.payNum,
                  plateNumber:that.needParam.carCode,
                })).then((response)=>{
                  that.$dialog.loading.close();

                  if(response.data.code == 200){
                    let obj = {};
                    obj.carnum = that.needParam.carCode;
                    obj.message = response.data.message;
                    obj.resultCode = response.data.data.resultCode;
                    if(response.data.data.resultCode == 1001){
                      obj.engineNumber = response.data.data.resultInfo.engineNumber;
                      obj.registerDate = response.data.data.resultInfo.registerDate;
                      obj.vehicleModelc = response.data.data.resultInfo.vehicleModelc;
                      obj.vin = response.data.data.resultInfo.vin;
                    }
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(obj));
                    that.show2 = false;
                    that.$router.push('/car_info_result');
                  }else if(response.data.code == 1002){
                    let obj = {};
                    obj.carnum = that.needParam.carCode;
                    obj.message = response.data.message;
                    obj.code = '1002';
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(obj));
                    that.show2 = false;
                    that.$router.push('/car_info_result');
                  }else{
                    that.show2 = false;
                    that.$dialog.notify({
                      mes:response.data.message,
                      timeout: 1500,
                    });
                  }
                }).catch(()=>{
                })
              },150)
              break;
            case '车辆违章查询':
              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
                that.$ajax.post(window.g.apiUrl+'/xiao/carViolate.do',JSON.stringify({
                  pid:that.needParam.pid,
                  payChannel:that.payNum,
                  plateNumber:that.needParam.carCode,
                  vin:that.needParam.carVin,
                  engineNumber:that.needParam.code,
                  plateType:that.needParam.carType,
                })).then((response)=>{
                  that.$dialog.loading.close();

                  if(response.data.code == 200){
                    let obj = {};
                    obj.carnum = that.needParam.carCode;
                    obj.message = response.data.message;
                    obj.resultCode = response.data.data.resultCode;
                    obj.code = response.data.code;
                    if(response.data.data.resultCode == 1001){
                      obj.resultInfo = response.data.data.resultInfo;
                      obj.arrlen = response.data.data.resultInfo.length;
                    }
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(obj));
                    that.show2 = false;
                    that.$router.push('/car_law_result');
                  }else if(response.data.code == 1002){
                    let obj = {};
                    obj.carnum = that.needParam.carCode;
                    obj.message = response.data.message;
                    obj.code = '1002';
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(obj));
                    that.show2 = false;
                    that.$router.push('/car_law_result');
                  }else{
                    that.show2 = false;
                    that.$dialog.notify({
                      mes:response.data.message,
                      timeout: 1500,
                    });
                  }
                }).catch(()=>{
                })
              },150)
              break;
            case '行驶证信息查询':
              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
                that.$ajax.post(window.g.apiUrl+'/xiao/VehiclelicenseX.do',JSON.stringify({
                  pid:that.needParam.pid,
                  payChannel:that.payNum,
                  plateNumber:that.needParam.carCode,
                  plateType:that.needParam.carType,
                })).then((response)=>{
                  that.$dialog.loading.close();

                  if(response.data.code == 200 || response.data.code == 1001 || response.data.code == 1002 || response.data.code == 1003){
                    let obj = {
                      resultInfo:{},
                    };
                    obj.carnum = that.needParam.carCode;
                    obj.cartype = that.needParam.text;
                    obj.message = response.data.message;
                    if(obj.message == '请求成功'){
                      obj.resultInfo = response.data.data.resultInfo;
                    }
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(obj));
                    that.show2 = false;
                    that.$router.push('/driver_card_result');
                  }else{
                    that.show2 = false;
                    that.$dialog.notify({
                      mes:response.data.message,
                      timeout: 1500,
                    });
                  }
                }).catch(()=>{
                })
              },150)
              break;
            case '驾驶证信息查询':
              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
                that.$ajax.post(window.g.apiUrl+'/xiao/Drivebook.do',JSON.stringify({
                  pid:that.needParam.pid,
                  payChannel:that.payNum,
                  name:'姓名',
                  licenseNo:that.needParam.code,
                })).then((response)=>{
                  that.$dialog.loading.close();

                  if(response.data.code == 200){
                    let obj = {};
                    obj.message = response.data.message;
                    obj.resultInfo = response.data.data;
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(obj));
                    that.show2 = false;
                    that.$router.push('/license_search_result');
                  }else{
                    that.show2 = false;
                    that.$dialog.notify({
                      mes:response.data.message,
                      timeout: 1500,
                    });
                  }
                }).catch(()=>{
                })
              },150)
              break;
            case '车辆VIN解析':
              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
                //http://127.0.0.1:90/xiao/VehicleVinAnalysisInfo.do
                //https://www.easy-mock.com/mock/5b4e9bec73960562e6fd7ef5/web/chuxian/carVin
                that.$ajax.post(window.g.apiUrl+'/xiao/VehicleVinAnalysisInfo.do',JSON.stringify({
                  pid:that.needParam.pid,
                  payChannel:that.payNum,
                  vin:that.needParam.carvin,
                })).then((response)=>{
                  that.$dialog.loading.close();

                  if(response.data.code == 200){
                    let obj = {};
                    obj.message = response.data.message;
                    if(response.data.data.resultCode == 1001){
                      obj.resultInfo = response.data.data.resultInfo;
                    }
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(obj));
                    that.show2 = false;
                    that.$router.push('/car_vin_result');
                  }else{
                    that.show2 = false;
                    that.$dialog.notify({
                      mes:response.data.message,
                      timeout: 1500,
                    });
                  }
                }).catch(()=>{
                })
              },150)
              break;
            case '车辆选配信息查询':
              that.$dialog.loading.open('正在查询');
              setTimeout(()=>{
                //http://127.0.0.1:90/xiao/VehicleSelectionInfo.do
                //https://www.easy-mock.com/mock/5b4e9bec73960562e6fd7ef5/web/chuxian/carChoose
                that.$ajax.post(window.g.apiUrl+'/xiao/VehicleSelectionInfo.do',JSON.stringify({
                  pid:that.needParam.pid,
                  payChannel:that.payNum,
                  vin:that.needParam.carvin,
                })).then((response)=>{
                  that.$dialog.loading.close();

                  if(response.data.code == 200){
                    let obj = {};
                    obj.message = response.data.message;
                    if(response.data.data.resultCode == 1001){
                      obj.resultInfo = response.data.data.resultInfo;
                    }
                    sessionStorage.setItem('TO_OBJECT',JSON.stringify(obj));
                    that.show2 = false;
                    that.$router.push('/car_choose_result');
                  }else{
                    that.show2 = false;
                    that.$dialog.notify({
                      mes:response.data.message,
                      timeout: 1500,
                    });
                  }
                }).catch(()=>{
                })
              },150)
              break;
          }
          })

        },
        chosTex(){
          if(this.showTex == true){
            this.showTex = false;
          }else{
            this.showTex = true;
          }
        },
        rechargeBtn(){
          this.$router.push('/recharge');
        }

      },
      watch:{
        showTex:function(val,oldVal){
          if(val == false){
            document.getElementsByClassName('pay_btn')[0].style.backgroundColor = '#e3e3e3';
          }else{
            document.getElementsByClassName('pay_btn')[0].style.backgroundColor = '#E72A26';
          }
        },
        showWrap:function(val,old){
          if(val == false){
            val = true;
          }
          this.show2 = val;
        },
        show2:function (val,old) {
          // console.log(val)
        }
      },
      created(){
        let that = this;
        this.$ajax.post(window.g.apiUrl+'/account/getBalance.do')
          .then((response)=>{
            if(response.data.code == 200){
              // that.balanceCount = response.data.data;
              if(response.data.data <= that.productPrice){
                that.balanceOpacity = true;
                that.normalBalance = false;
                that.balanceCount = response.data.data;
                that.payNum = 0;
                that.payWay = require('../../assets/api/right.png');
                document.getElementsByClassName('pay_way')[0].style.opacity = .5;
              }
            }else{
              // that.$dialog.notify({
              //   mes: '余额获取超时，请稍后重试',
              //   timeout: 1500,
              // });
            }
          }).catch(()=>{
        })
      }

    }
</script>

<style scoped>
  .pay_logo{
    width: 0.5rem;
    height: 0.5rem;
  }
  .pay_content{
    width: 100%;
    position: absolute;
    top: 0;
    bottom: 1rem;
    padding: 0 .24rem;
    background: #fff;
  }
  .pay_title{
    height: 1rem;
    border-bottom: 1px solid #f2f2f2;
  }
  .pay_center{
    display: flex;
    align-items: center;
    margin-top: .5rem;
    justify-content: center;
  }
  .pay_img{
    width: .6rem;
    height: .4rem;
  }
  .pay_count{
    margin-top: .44rem;
    padding-bottom: .86rem;
    border-bottom: 1px solid #f2f2f2;
    font-weight: bold;
    font-size: .5rem;
  }
  .pay_way{
    width: 100%;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f2f2f2;
  }
  .pay_way div{
    display: flex;
    align-items: center;
  }
  .pay_btn{
    width: 100%;
    height: 1rem;
    position: absolute;
    bottom: 0;
    background: #E72A26;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .agree_ment{
    font-size: 0.24rem;
    display: flex;
    align-items: center;
    margin-top: 0.3rem;
    justify-content: flex-end;
  }
  .agree_img{
    width: 0.32rem;
    height: 0.32rem;
  }

</style>
